package com.zg.ktcomwan.vm

import androidx.lifecycle.MutableLiveData
import com.zg.ktcomwan.base.BaseViewModel
import com.zg.ktcomwan.data.BaseListResp
import com.zg.ktcomwan.model.ArticleBean
import com.zg.ktcomwan.repository.ArticleRepositroty

/***
 * @Author:      zxd
 * @CreateDate:  2021/6/3 14:10
 * @Description:
 */
class ArticleViewModel : BaseViewModel() {

    val article by lazy { MutableLiveData<List<ArticleBean>>() }

    val repository = ArticleRepositroty()

    fun getArticleList() {
        launchUI {
            val result = repository.getArticleList(0)
            article.value = result.data.datas
        }
    }

}